<!--
 * @Author: 孙开源 && sunkaiyuan@namenode.cn
 * @Date: 2023-09-22 10:26:19
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @LastEditTime: 2023-09-24 13:06:25
 * @Description: 
 * 
-->
<template>
  <el-dialog draggable overflow v-model="visible" :title="'修改进度'" :width="200" destroy-on-close @closed="$emit('closed')">
    <el-form ref="dialogForm" label-width="70px">
      <el-row>
        <el-col :span="24">
          <el-form-item label="修改进度" prop="schedule_id">
            <skDicSelect v-model="schedule_id" :code="'AcceptanceSchedule'">
            </skDicSelect>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" :loading="isSaveing" @click="submit()">保 存</el-button>
    </template>
  </el-dialog>
</template>

<script>
import skDicSelect from "@/components/skDicSelect";
export default {
  emits: ["success", "closed"],
  components: { skDicSelect },
  data() {
    return {
      ids: {},
      schedule_id: 0,
      visible: false,
      isSaveing: false,
    };
  },

  mounted() { },
  methods: {
    //显示
    open() {
      this.visible = true;
      return this;
    },
    //表单提交方法
    submit() {
      this.isSaveing = true;
      this.$API.finance.acceptance.saveSchedule.post({ ids: this.ids, schedule_id: this.schedule_id, }).then((res) => {
        if (res.code == 200) {
          this.$emit("success", this.form);
          this.visible = false;
          this.$message.success("操作成功");
        }
      }).finally(() => this.isSaveing = false);

    },
    //表单注入数据
    setData(data) {
      this.ids = data.map(v => v.id);
    },
  },
};
</script>
<style></style>
